<?php
	$pathToThis = pathinfo(__FILE__);
	$retPERSISTENCEEXCEPTION = getcwd();
	chdir($pathToThis['dirname']);
	
	require_once "../excecoes/MySqlErrorMessages.class.php";

class PersistenceException extends Exception {

	private $textoMsg = "";
	private $errorNumber = null;

	function __construct($exception, $textoMsg = null, $errorNumber = null) {
		$this->exception = $exception;
		$this->textoMsg = $textoMsg;
		$this->errorNumber = $errorNumber;
	}

	function display() {
		$mySqlErrorMessages = new MySqlErrorMessages();
		$ret = "" . $mySqlErrorMessages->getConvertedErrorMsg($this->textoMsg, $this->errorNumber);
		return $ret;
	}
	
	function getErrorNumber() {
		return $this->errorNumber;
	}
	
	function getErrorMsg() {
		return $this->textoMsg;	
	}
}
chdir($retPERSISTENCEEXCEPTION);
?>